<?php

// the usual include
include("basepath.php");

// get the file and directory
$file=$_GET["file"];
$dir=$_GET["dir"];

// combine the two to get the full path without it being in the URL
// basepath is the filesystem directory
$fullpath="$basepath" . "$dir";
// webpath is the web server path
$fullwebpath="$webpath" . "$dir";
//assemble the real filename
$filename="$fullpath" . "/" . "$file";

// if (!rmdir($filename))
//   {
//   echo ("<html><head><link rel='stylesheet' type='text/css' href='style.css'></head><body>Error Deleting $fullpath/$file. <a href='fileman.php'>Return to File Manager page</a></body></html>");
//   }
if (!rmdir($filename) && !unlink($filename))
  {
   $msg="<font color=red>Error deleting $filename.</font>";
   header( "Refresh: 0; url=$refreshurl?dir=$dir&msg=$msg" );
  // echo ("<html><head><link rel='stylesheet' type='text/css' href='style.css'></head><body>Error Deleting $fullpath/$file. <a href='fileman.php'>Return to File Manager page</a></body></html>");
  }
else
  {
   $msg = "<font color=green>File deleted successfully.</font>";
   header( "Refresh: 0; url=$refreshurl?dir=$dir&msg=$msg" );
//  echo ("<html><head><link rel='stylesheet' type='text/css' href='style.css'></head><body>
// File deleted successfully.<p>
// <a href='fileman.php?path=$dir'>Return to File Manager page</a>
// </body></html>");
  }
?> 
